// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,3) == 0;
	question = "special";
	text1 = "You have almost reached the gates of Gazaki-Uss, fortress of the drakons. You can see its massive stone walls looming over you to the east.";
	text2 = "Between here and there, you can see several outbuildings and some small fields of crops. There isn't enough food being grown here to support a city like this. The rest must be grown on the other side of the keep, in rebel lands.";
	text3 = "You can also see lots of creations. Defenders of the fortress, standing in long, neat lines. You'll have to get closer to see more.";
	action = SET_SDF 58 3 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,4) == 0 && gf(58,5) == 0;
	question = "special";
	text1 = "Now that you are closer to Gazaki-Uss, you can make out more details. There is a small encampment to the northeast. It looks like serviles are on guard outside.";
	text2 = "There is a large, stone dome to the southeast. You can hear the sounds of machinery and magic coming from it. It must be a workshop.";
	text3 = "You also get a good look at the fields of creations. They are war creations, standing calm and motionless, waiting to defend the keep from a surprise attack. Fortunately, they don't appear to want to attack you.";
	action = SET_SDF 58 4 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(58,16) == 0 && gf(100,23) > 0;
	question = "special";
	text1 = "Outside Gazaki-Uss, the Shaper assault has already begun. The Shapers are throwing powerful creations at the gate of the fortress as quickly as they can make them. A stream of drakon-made defenders come out in the other direction.";
	text2 = "The two sides seem to be in a stalemate. Perhaps, with your help, they can fight their way to the enemy gates.";
	action = SET_SDF 58 16 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You get close to one of the friendly creations. It is weak and confused. The Shaper that's controlling it is far away.";
	text2 = "You step forward and extend your will. You reassure the creature and lend your strength to it. In moments, it is ready to fight with great power and confidence.";
	text3 = "It makes you wonder how quickly this war would have been won if the Shapers spent more time on the front lines and less back in their fortresses.";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The road is patrolled by a pack of creations. This close to Gazaki-Uss, they must be rebel creations. They must be instructed to not attack immediately. They stare at you, waiting for you to prove they shouldn't kill you.";
	text2 = "You stare back at them, not sure what to do. When they realize that you don't have anything to show them, they attack.";
	text3 = "When they get close, you hold up your amulet. This seems to have an effect on them. Something in their simple minds recalls that they were given instructions to follow should that trinket be presented to them.";
	text4 = "You do your best to take advantage of this lull and calm them. However, you aren't authoritative enough. The moment of confusion passes, and the creatures forget what to do when they see the amulet. Then they fall back to their default plan ...";
	text5 = "You do your best to take advantage of this lull and calm them. You are authoritative enough to comfort the creatures. They walk down the road past you, leaving you in peace.";
	code =
		clear_strings();
		as(1);
		if (has_spec_item(2) == 0)
			as(2);
			else {
				as(3);
				if (get_stat(20) < 7)
					as(4);
					else as(5);
				}
	break;
	
begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This creation stands almost motionless. It doesn't even sniff or snarl at you when you get close. The elements have no effect on it. Occasionally, it bends down and eats some of the food the serviles bring. ";
	text2 = "The creatures are disciplined, but it's a pretty miserable post. The drakons can be as mercifully efficient with their creations as the Shapers can.";
	
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";
	
begintalknode 8; // pacifier
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You examine this pacification pylon. It appears to have been stolen and brought here, with some difficulty, from Shaper lands.";
	text2 = "The drayks have dismantled it to figure out how it works. It is beyond your ability to repair it.";
	
begintalknode 9; // machie
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The drayk was working on fixing this odd piece of machinery. It has no power, and you have no idea what it does.";	
	
begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The serviles in this stockade are completely and universally hostile. They turn away when you approach.";
	text2 = "Out of gratitude for your help exposing Roga, they turn away slightly slower than they would otherwise.";
	code =
		if (gf(58,2) == 0)
			rs(2);
	break;
	
begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The servile cultists have had enough of you. One of them shouts an alarm, and they turn to attack.";
	
begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This drayk is poring over some paperwork. You see that the papers are schematics for some sort of piece of Shaping machinery. The drayk makes notes on them with a pen held delicately in its large claws.";
	text2 = "You try to speak to the drayk, but it waves you away irritably. You don't think it even notices that you were from the west.";
	
begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to speak to the drayk, but it is too upset about the accident. And even more upset about the valuable schematics it lost.";
	
begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = "The sign says:";
	text2 = "  PRIVATE STOCKADE";
	text3 = "  BY DECLARATION OF GHALDRING";
	text4 = "  ONLY THOSE ALLOWED BY ROGA CAN ENTER";
	
begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The sign says:";
	text2 = "  EQUIPMENT WORKSHOP";
	text3 = "  DELIVER ALL WORK ORDERS TO TOROTH";
	
begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to talk to this watchpodling, but this sort of creation can't speak.";
	
begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";
	
begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";
	
begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";
	
begintalknode 20;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";
	


//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Roga";
	text1 = "There is a muscular, aging servile sitting on this wooden throne. Like most of the tribal serviles, he bears many tattoos and scars. Most of his original tattoos have faded, in fact, and have been replaced with new patterns.";
	text2 = "When he sees you, he stands and draws his blade. _Outsider! Using trickery to enter throne room of Roga. You are not allowed here. Say your words and leave, or die._";
	text5 = "Roga stares up at you, his blade ready in his hand. You suspect that he has not been in a fight for a long time. He is eager to get back in practice. _Speak and go. You try our patience._";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I have a message for you. (Lie.)";
	text1 = "_So I hear. Then let me see it. Now._ You suddenly remember that you don't have an actual message to give. The serviles are quite irritated.";
	action = END_TALK;
	code =
		sf(58,9,1);
		set_attitude(1006,10);
	break;
	
begintalknode 32;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I'd like to know about your colony.";
	text1 = "_We hunger and suffer to focus will and draw out power. Our hate for Shapers and those corrupted by them keeps us strong. That is all you need know. But pain makes patience short. So go, or regret it._";

begintalknode 33;
	state = 30;
	nextstate = 31;
	condition = gf(42,23) == 1;
	question = "I recently met a servile named Pepoy. A prisoner of the Shapers.";
	text1 = "This draws the immediate attention of everyone in the room. The other serviles begin to whisper to each other. This name means something to them.";
	text2 = "Roga suddenly seems a little less confident than he did before. _Pepoy was lost to us. The Shapers took him. He must be dead._";

begintalknode 34;
	state = 30;
	nextstate = -1;
	condition = 1;
	question = "I've had enough of your insolence. (Attack.)";
	text1 = "The serviles are not the least bit afraid of you. They are eager to fight and die, even for a small provocation. They draw their blades and charge.";
	action = END_TALK;
	code =
		sf(58,9,1);
		set_attitude(1006,10);
	break;

begintalknode 35;
	state = 30;
	nextstate = -1;
	condition = gf(100,22) < 10;
	question = "I'll be going now. (Leave.)";
	text1 = "_You go, then. Is wise. Our patience is very, very short._";
	action = END_TALK;

begintalknode 36;
	state = 30;
	nextstate = -1;
	condition = gf(100,22) >= 10;
	question = "I'll be going now.";
	text1 = "You start to turn to go, but something about the insolent looks of the serviles around you doubles the anger you feel. Your hands start to glow. Everything starts to slowly turn red.";
	action = END_TALK;
	code =
		sf(58,9,1);
		set_attitude(1006,10);
	break;

begintalknode 37;
	state = 31;
	nextstate = 32;
	condition = 1;
	question = "He was not yet dead when I met him. He told me the name of the spy who betrayed him.";
	text1 = "Roga looks like he is about to choke. _That is a strange story. I see no reason we should believe you._";
	text2 = "Another servile says, _Who? Who was it?_";

begintalknode 38;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "I'd rather not say.";
	text1 = "Roga is enraged. _Trickery! Shaper trickery! Enough of this! Slay the intruder!_";
	action = END_TALK;
	code =
		sf(58,9,1);
		set_attitude(1006,10);
	break;

begintalknode 39;
	state = 32;
	nextstate = -1;
	condition = get_stat(20) < 10;
	question = "Pepoy said that you betrayed him, Roga.";
	text1 = "The serviles are shocked. And, you suspect, not entirely surprised. However, you aren't convincing enough to get them to turn against their leader.";
	text2 = "Roga is enraged. _Trickery! Shaper trickery! Enough of this! Slay the intruder!_";
	action = END_TALK;
	code =
		sf(58,9,1);
		set_attitude(1006,10);
	break;

begintalknode 40;
	state = 32;
	nextstate = -1;
	condition = get_stat(20) >= 10;
	question = "Pepoy was sure that you betrayed him, Roga.";
	text1 = "The serviles are shocked. And, you suspect, not entirely surprised. You are extremely convincing. One of them points at Roga and shouts, _You hoard wealth! World things! Where are they from? You never say?_";
	text2 = "Another says, _You were one who sends Pepoy. You know where. None others knew. And then Pepoy caught._";
	text3 = "Roga tries to say something in response, but you don't hear it over the shouting. These serviles, whatever their faults, are creatures of action ...";
	action = END_TALK;
	code =
		sf(58,7,1); 
		award_party_xp(150,22);
		set_attitude(35,10);
	break;


//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Toroth";
	text1 = "The drayks in this dome are unusual for their kind. They are technicians. Despite their powerful muscles and ability to breathe fire, they seem more interested in tinkering with machinery and repairing pylons.";
	text2 = "The drayk here, though not the largest or strongest of their number, is clearly the leader. As she paces around this broken piece of machinery, it takes some time for you to break through her total focus and get her attention.";
	text3 = "When you do, she is irritated. _I am Toroth, and this dome is ours. Ghaldring gave it to us. Why have you disrupted my work? Be quick._";
	text5 = "Toroth continues to pace around the broken machine, occasionally looking closely at a component or wielding a tool held in her large claw. She is doing her best to pretend that you aren't here.";
	action = INTRO;

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "What are you working on?";
	text1 = "She sighs. _An essence stabilizer. It holds a cloud of essence mist in a stable position over a platform, so that a drakon can work it as slowly as needed._";
	text2 = "Ah. Yes. An essence stabilizer. Of course.";
	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Tell me about your workshop?";
	text1 = "She gives her head an irritated shake.";
	
begintalknode 53;
	state = 50;
	nextstate = 51;
	condition = 1;
	question = "Can you teach me about Shaping?";
	text1 = "She looks at you, amused. _I do not Shape. Only the drakons learn Shaping. It falls to us smaller creatures to give them the means to do so. For now._";
	
begintalknode 54;
	state = 51;
	nextstate = 52;
	condition = 1;
	question = "Do you want to learn to Shape?";
	text1 = "_No. This workshop is my true calling. My love._";
	
begintalknode 55;
	state = 51;
	nextstate = -1;
	condition = 1;
	question = "The drakons forbid others from Shaping?";
	text1 = "_Not forbid, but they do not share their secrets either. That will change, I am sure. They can't keep that useful and glorious art from others forever. But it does not concern me. My calling is here._";
	
begintalknode 56;
	state = 52;
	nextstate = -1;
	condition = 1;
	question = "And what do the other drayks think of that?";
	text1 = "_They mock us. They have certain names for us. Names I will not repeat. No matter. Us four do more to help us fight the war than any fifty other drayks._";
	
begintalknode 57;
	state = 50;
	nextstate = 53;
	condition = gf(34,12) == 1;
	question = "I recently met a drayk named Jesstress.";
	text1 = "Toroth looks slightly nervous. _Ah, yes. The Trakovite. The one who would deny the rebels the powers we need to survive, the one who would make my work and my life meaningless._";
	text2 = "_The one who escaped, narrowly. The traitor. And what does Jesstress say?_";
	
begintalknode 58;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "Nothing important. Never mind.";
	text1 = "Toroth nods, relieved. _Then leave me. There is much to do and never enough time to do it._ She turns away.";
	action = END_TALK;
	
begintalknode 59;
	state = 53;
	nextstate = -1;
	condition = 1;
	question = "Jesstress sent me to challenge you. And I do.";
	text1 = "_What? You challenge me? And you think I will meet you on a dueling ground somewhere? Give up my allies for some parody of an honorable fight?_";
	text2 = "_No. Drayks! A Shaper spy! A murderer! Help me!_";
	action = END_TALK;
	code =
		make_zone_hostile();
	break;
	
begintalknode 60;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "I'll be going now.";
	text1 = "She snorts. _Don't let me stop you._ She returns to her work.";
	action = END_TALK;


//

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Ukri";
	text1 = "This small shop is run by a young servile. She is sitting in a rocking chair. This is an understandably dangerous place to run a store. Her leg is wrapped in bandages, and she holds a baton in her lap.";
	text2 = "She says, _Come in. I am Ukri. Look around. Since you're here, I'll have to hope you're not a loyalist._";
	text5 = "Ukri sits in the chair and rocks gently, being very careful not to nudge her leg too much. She seems friendly, but she never lets her baton get too far from her.";
	action = INTRO;

begintalknode 71;
	state = 70;
	nextstate = 71;
	condition = 1;
	question = "This is an odd place to have a shop.";
	text1 = "_This is where the drakons wanted it. When our agents and soldiers pass near here, I can trade with them. They get what they need, I get supplies for the fort._";
	text2 = "_It used to be farther west, but that didn't work._ She looks down at her leg sadly.";

begintalknode 72;
	state = 71;
	nextstate = -1;
	condition = 1;
	question = "Do you really get many customers?";
	text1 = "_No. But the ones I get really, really need supplies._";

begintalknode 73;
	state = 71;
	nextstate = -1;
	condition = 1;
	question = "How did you hurt your leg?";
	text1 = "_My shop was in what the Shapers call Fort Vengeance. Then the Shapers retook it. I was too slow leaving the fort, and one of their wingbolts burned me._";
	text2 = "_So I rebuilt my shop here. The drakons helped me get started again. They need me out here._";

begintalknode 74;
	state = 70;
	nextstate = 72;
	condition = gf(58,15) == 0;
	question = "Can you trade with me?";
	text1 = "_Of course. All I need is for you to swear that you are loyal to the serviles and will defy the Shapers. Then I can help you with a clear conscience._";
	text2 = "She looks at you intently. You suspect that a non-committal answer won't get you far here.";
		
begintalknode 75; // pro shaper
	state = 72;
	nextstate = -1;
	condition = get_flag(58,15) == 0;
	question = "I can't do that. I support the Shapers.";
	text1 = "She nods. _A diplomat, then. Gazaki-Uss it is then. You should proceed. I can't help you._";
	action = SET_SDF 58 15 1;
	code = 
		inc_flag(100,0,2);
	break;

begintalknode 76; // anti shaper
	state = 72;
	nextstate = -1;
	condition = get_flag(58,15) == 0;
	question = "I am fighting against the Shapers.";
	text1 = "She nods, pleased. _I am glad to hear it. I would be happy to trade with you._";
	action = SET_SDF 58 15 2;
	code = 
		inc_flag(100,0,-2);
	break;

begintalknode 77;
	state = 70;
	nextstate = -1;
	condition = gf(58,15) == 1;
	question = "I would like to talk about something else.";
	text1 = "_I am no diplomat, and I am not authorized to speak with them. You should go east to Gazaki-Uss. Good day._";
	action = END_TALK;

begintalknode 78;
	state = 70;
	nextstate = -1;
	condition = gf(58,15) == 2;
	question = "Let me see your goods.";
	text1 = "You conclude your business.";	
	code = 
		begin_shop_mode("Ukri's Shop",
		  "Ukri is risking great injury to run this little shop. She has a very odd mix of equipment.",
		  52,4,0);	
	break;

begintalknode 79;
	state = 70;
	nextstate = -1;
	condition = gf(58,15) == 2;
	question = "I want to sell something.";
	text1 = "You conclude your business.";	
	code = 
		begin_sell_mode();
	break;

begintalknode 80;
	state = 70;
	nextstate = -1;
	condition = gf(58,15) == 2;
	question = "I don't need anything else.";
	text1 = "_Then safe travels to you._";
	action = END_TALK;

//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = "There are serviles standing guard at the entrance to this stockade. They bear many scars on their faces and arms. Only some of them were intentionally inflicted. They look at you with fear and mistrust.";
	text2 = "The guard stops you. _No outsider. This is private land of tribe. Given by Ghaldring for focus and war arts. Enter and we practice on you._";
	text3 = "The guard waves you by. _Enter. But one misstep, and we practice arts of war on you._";
	text4 = "Something about the creature's attitude begins to fill you with rage. A hot fury that threatens to turn into violence at any moment. Staying around these creatures might be dangerous.";
	code =
		if (gf(58,6) > 0)
			rs(2);
			else rs(3);
		if (gf(100,22) < 10)
			rs(4);
	break;
	
begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "Tell me about your tribe.";
	text1 = "The guard shakes his head. _You are outsider. Corrupted by Shaper arts. We learn magic through focus and ordeal. No reason to talk to you._";
	text2 = "_We learn that from Roga. He showed how easy it is to be corrupt._";
	code =
		if (gf(58,2) == 0)
			rs(2);
	break;
	
begintalknode 92;
	state = 90;
	nextstate = 91;
	condition = gf(58,6) == 0;
	question = "Who is the leader here?";
	text1 = "_Leader is Roga. Most loyal, most learned._";
		
begintalknode 93;
	state = 90;
	nextstate = -1;
	condition = gf(58,6) == 0;
	question = "I would like to enter.";
	text1 = "The guard steps aside. _Then enter. But, when you do, we will attack you. Good practice for us._";
	action = END_TALK;
		
begintalknode 94;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "I'll be going now.";
	text1 = "The guard silently steps back.";
	action = END_TALK;
		
begintalknode 95;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "I would like to meet Roga.";
	text1 = "_Roga gave word. No Shapers. No outsiders. You must go._";

begintalknode 96;
	state = 91;
	nextstate = -1;
	condition = get_stat(20) < 7;
	question = "I need to see Roga. I have an urgent message from the west. (Lie.)";
	text1 = "The guard, of course, demands to see the message. You say that it is for Roga's eyes only. He offers to take it in. You say that you have to deliver it personally.";
	text2 = "Alas, the guard doesn't believe you. You end in a stalemate. He won't let you in.";

begintalknode 97;
	state = 91;
	nextstate = -1;
	condition = get_stat(20) >= 7;
	question = "I need to see Roga. I have an urgent message from the west. (Lie.)";
	text1 = "The guard, of course, demands to see the message. You say that it is for Roga's eyes only. He offers to take it in. You say that you have to deliver it personally.";
	text2 = "You are very convincing. Eventually, the guard relents. _You may pass. One misstep, and we practice arts of war on you._";
	action = END_TALK;
	code =
		sf(58,6,1);
		award_party_xp(150,20);
	break;
	
begintalknode 98;
	state = 91;
	nextstate = -1;
	condition = 1;
	question = "I'll be going now.";
	text1 = "The guard silently steps back.";
	action = END_TALK;

begintalknode 110;
	state = -1;
	nextstate = 110;
	condition = 1;
	question = "Name";
	text1 = "You examine the power spiral. It is large, charged, and functioning. It is sitting back here out of the way, probably waiting to be shipped to some drakon workshop.";
	text2 = "It is quite powerful. You tinker with it, but you can't figure out how to control it. Anything you did would probably result in an instant explosion.";
	text3 = "The control switches are peculiar and nonstandard, but you think that you understand them. Since it isn't hooked up to any conduits, this spiral currently has one possible purpose: to explode.";
	text5 = "There is nothing else to do with this spiral. It's about to explode.";
	code =
		clear_strings();
		if (gf(58,11) > 0)
			as(5);
			else {
				as(1);
				if (get_stat(21) >= 10)
					as(3);
					else as(2);
				}
	break;
	
begintalknode 111;
	state = 110;
	nextstate = -1;
	condition = gf(58,11) == 0 && get_stat(21) >= 10;
	question = "Activate the spiral.";
	text1 = "You flip a switch, turn a knob, and press a button. There is a hiss and a hum. The power spiral starts to pulse with energy. Slowly at first, then faster.";
	text2 = "It appears to have a very short fuse ...";
	action = END_TALK;
	code =
		sf(58,11,1);
	break;
	
begintalknode 112;
	state = 110;
	nextstate = -1;
	condition = 1;
	question = "Leave it alone.";
	text1 = "You back away from the powerful and dangerous device.";
	action = END_TALK;

begintalknode 114;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The dome is shaken by an enormous explosion. The air fills with dust. Showers of stone chips fall from the ceiling.";
	text2 = "Amazingly, the ceiling holds.";												